export default {
  data () {
    return {
      innerHeight: 0,
      contentHeight: 0,
      projectHeight: 0,
      controlHeight: 0
    }
  },
  created () {
    this.setInnerHeight()
  },
  mounted () {
    this.handleUp()
    this.handleDown()
  },
  methods: {
    setInnerHeight () {
      this.setHeight()
      window.addEventListener('resize', () => {
        this.setHeight()
      })
    },
    setHeight () {
      this.innerHeight = window.innerHeight
      this.contentHeight = window.innerHeight - 236
      this.projectHeight = window.innerHeight - 226 - 115
      this.controlHeight = window.innerHeight - 226 - 70
    },
    handleUp () {
      if (this.$refs.up) {
        this.$velocity(this.$refs.up, {
          translateY: -2
        }, {
          loop: true
        })
      }
      if (this.$refs.devStatusUp) {
        this.$velocity(this.$refs.devStatusUp, {
          translateY: -2
        }, {
          loop: true
        })
      }
    },
    handleDown () {
      if (this.$refs.down) {
        this.$velocity(this.$refs.down, {
          translateY: 2
        }, {
          loop: true
        })
      }
      if (this.$refs.rateStatusDown) {
        this.$velocity(this.$refs.rateStatusDown, {
          translateY: 2
        }, {
          loop: true
        })
      }
    }
  }
}
